package cn.lanqiao.service.impl;

import cn.lanqiao.entiy.User;
import cn.lanqiao.service.UserService;

public class UserServiceImpl implements UserService{
	private cn.lanqiao.dao.UserDao dao = new cn.lanqiao.dao.impl.UserDaoImpl();
	@Override
	public User loginUser(String uuser, String upassword) {
		User curUser = dao.search(uuser);
		if(curUser!=null) {
			if(curUser.getUpassword().equals(upassword)) {
				return curUser;
			}
		}
		return null;
	}
	@Override
	public void addUser(User user) {
		dao.add(user);
	}
	@Override
	public void updateUser(User user) {
		dao.update(user);
	}

}
